//
//  myCollectionViewCell.m
//  SmartHome
//
//  Created by 赵嘉诚 on 15/4/8.
//  Copyright (c) 2015年 赵嘉诚. All rights reserved.
//

#import "myCollectionViewCell.h"

@implementation myCollectionViewCell

- (UIImageView *)imageView
{
    if(!_imageView){
        _imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Image/scene_n"]];
        [_imageView setFrame:CGRectMake(0, 0, 50, 50)];
        _imageView.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 3);
    }
    return _imageView;
}

- (UILabel *)label
{
    if(!_label){
        _label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, 30)];
        _label.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 5 * 4);
        _label.textAlignment = NSTextAlignmentCenter;
        _label.textColor = [UIColor blackColor];
    }
    return _label;
}

- (void)setImageViewWithImage:(UIImage *)image
{
    [self.imageView removeFromSuperview];
    self.imageView = [[UIImageView alloc] initWithImage:image];
    [self.imageView setFrame:CGRectMake(0, 0, 60, 60)];
    self.imageView.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 3);
}

- (void)setNewSceneImage:(UIImage *)image
{
    [self.imageView removeFromSuperview];
    self.imageView = [[UIImageView alloc] initWithImage:image];
    [self.imageView setFrame:CGRectMake(0, 0, 75, 75)];
    self.imageView.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
}

@end
